package cn.wit.summit.chwan.widgets;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.Html;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import cn.wit.summit.chwan.R;
import cn.wit.summit.chwan.ui.base.MyApplication;
import cn.wit.summit.chwan.utils.StringUtils;

/**
 * Created by tangbl on 2018/4/20.
 */

public class LoginGuideDialog extends AlertDialog {

    private TextView currencyPromptMsgTx;
    private TextView ennegerNumber;
    private TextView currencyPromptCancelBt;
    private TextView okButn;
    public LoginGuideDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setCancelable(false);  //是否获取界外焦点
        Window dialogWindow = getWindow();
        dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);
        dialogWindow.setGravity(Gravity.CENTER);
        setContentView(R.layout.dialog_login_guid_view);
        currencyPromptMsgTx = findViewById(R.id.currencyPromptMsgTx);
        ennegerNumber = findViewById(R.id.ennegerNumber);
        currencyPromptCancelBt = findViewById(R.id.currencyPromptCancelBt);
        okButn = findViewById(R.id.okButn);
        currencyPromptMsgTx.setText(Html.fromHtml(" 下载游戏，可以获取<font color=\"#fb762c\">能量奖励</font>并<font color=\"#fb762c\">提现</font>"), TextView.BufferType.SPANNABLE);
        ennegerNumber.setText(MyApplication.cfgPlug.getValue_default_energy_num()+"");
    }

    public void setOkBtn(View.OnClickListener clickListener) {
        okButn.setOnClickListener(clickListener);
    }


    public void setCancleBtn( View.OnClickListener clickListener) {
        currencyPromptCancelBt.setOnClickListener(clickListener);

    }




}
